<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <title>DSpace Documentation : Directories</title>
	    <link rel="stylesheet" href="styles/site.css" type="text/css" />
        <META http-equiv="Content-Type" content="text/html; charset=UTF-8">	    
    </head>

    <body>
	    <table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
		    <tr>
			    <td valign="top" class="pagebody">
				    <div class="pageheader">
					    <span class="pagetitle">
                            DSpace Documentation : Directories
                                                    </span>
				    </div>
				    <div class="pagesubheading">
					    This page last changed on Feb 17, 2011 by <font color="#0050B2">helix84</font>.
				    </div>

				    <h1><a name="Directories-DSpaceSystemDocumentation%3ADirectoriesandFiles"></a>DSpace System Documentation: Directories and Files</h1>

<style type='text/css'>/*<![CDATA[*/
div.rbtoc1297951565554 {margin-left: 0px;padding: 0px;}
div.rbtoc1297951565554 ul {list-style: none;margin-left: 0px;}
div.rbtoc1297951565554 li {margin-left: 0px;padding-left: 0px;}

/*]]>*/</style><div class='rbtoc1297951565554'>
<ul>
    <li><span class='TOCOutline'>1</span> <a href='#Directories-Overview'>Overview</a></li>
    <li><span class='TOCOutline'>2</span> <a href='#Directories-SourceDirectoryLayout'>Source Directory Layout</a></li>
    <li><span class='TOCOutline'>3</span> <a href='#Directories-InstalledDirectoryLayout'>Installed Directory Layout</a></li>
    <li><span class='TOCOutline'>4</span> <a href='#Directories-ContentsofJSPUIWebApplication'>Contents of JSPUI Web Application</a></li>
    <li><span class='TOCOutline'>5</span> <a href='#Directories-ContentsofXMLUIWebApplication%28akaManakin%29'>Contents of XMLUI Web Application (aka Manakin)</a></li>
    <li><span class='TOCOutline'>6</span> <a href='#Directories-LogFiles'>Log Files</a></li>
<ul>
    <li><span class='TOCOutline'>6.1</span> <a href='#Directories-log4j.propertiesFile.'>log4j.properties File.</a></li>
</ul>
</ul></div>

<h2><a name="Directories-Overview"></a>Overview</h2>

<p>A complete DSpace installation consists of three separate directory trees:</p>

<ul>
	<li><b>The source directory:</b>:  This is where (surprise&#33;) the source code lives. Note that the config files here are used only during the initial install process. After the install, config files should be changed in the install directory. It is referred to in this document as <em>[dspace-source]</em>.</li>
	<li><b>The install directory:</b>:  This directory is populated during the install process and also by DSpace as it runs. It contains config files, command-line tools (and the libraries necessary to run them), and usually &#45;&#45; although not necessarily &#45;&#45; the contents of the DSpace archive (depending on how DSpace is configured). After the initial build and install, changes to config files should be made in this directory. It is referred to in this document as <em>[dspace]</em>.</li>
	<li><b>The web deployment directory:</b>:  This directory is generated by the web server the first time it finds a dspace.war file in its webapps directory. It contains the unpacked contents of dspace.war, i.e. the JSPs and java classes and libraries necessary to run DSpace. Files in this directory should never be edited directly; if you wish to modify your DSpace installation, you should edit files in the source directory and then rebuild. The contents of this directory aren't listed here since its creation is completely automatic. It is usually referred to in this document as <em>[tomcat]/webapps/dspace</em>.</li>
</ul>


<h2><a name="Directories-SourceDirectoryLayout"></a>Source Directory Layout</h2>

<ul>
	<li><em>[dspace-source]</em>
	<ul>
		<li><em>dspace/</em> &#45; Directory which contains all build and configuration information for DSpace
		<ul>
			<li><em>CHANGES</em> &#45; Detailed list of code changes between versions.</li>
			<li><em>KNOWN_BUGS</em> &#45; Known bugs in the current version.</li>
			<li><em>LICENSE</em> &#45; DSpace source code license.</li>
			<li><em>README</em> &#45; Obligatory basic information file.</li>
			<li><em>bin/</em> &#45; Some shell and Perl scripts for running DSpace command-line tasks.</li>
			<li><em>config/</em> &#45; Configuration files:
			<ul>
				<li><em>controlled-vocabularies/</em> &#45; Fixed, limited vocabularies used in metadata entry</li>
				<li><em>crosswalks/</em> &#45; Metadata crosswalks - property files or XSL stylesheets</li>
				<li><em>dspace.cfg</em> &#45; The Main DSpace configuration file (You will need to edit this).</li>
				<li><em>dc2mods.cfg</em> &#45; Mappings from Dublin Core metadata to <a href="http://www.loc.gov/standards/mods/" title="MODS">MODS</a> for the METS export.</li>
				<li><em>default.license</em> &#45; The default license that users must grant when submitting items.</li>
				<li><em>dstat.cfg</em> , <em>dstat.map</em> &#45; Configuration for statistical reports.</li>
				<li><em>input-forms.xml</em> &#45; Submission UI metadata field configuration.</li>
				<li><em>news-side.html</em> &#45; Text of the front-page news in the sidebar, only used in JSPUI.</li>
				<li><em>news-top.html</em> &#45; Text of the front-page news in the top box, only used in teh JSPUI.</li>
				<li><em>emails/</em> &#45; Text and layout templates for emails sent out by the system.</li>
				<li><em>registries/</em> &#45; <b>Initial</b> contents of the bitstream format registry and Dublin Core element/qualifier registry. These are only used on initial system setup, after which they are maintained in the database.</li>
			</ul>
			</li>
			<li><em>docs/</em> &#45; DSpace system documentation. The technical documentation for functionality, installation, configuration, etc.</li>
			<li><em>etc/</em> &#45;<br/>
This directory contains administrative files needed for the install process and by developers, mostly database initialization and upgrade scripts. Any <em>.xml</em> files in <em>etc/</em> are common to all supported database systems.
			<ul>
				<li><em>postgres/</em> &#45; Versions of the database schema and updater SQL scripts for PostgreSQL.</li>
				<li><em>oracle/</em> &#45; Versions of the database schema and updater SQL scripts for Oracle.</li>
			</ul>
			</li>
			<li><em>modules/</em> &#45; The Web UI modules "overlay" directory. DSpace uses Maven to automatically look here for any customizations you wish to make to DSpace Web interfaces.
			<ul>
				<li><em>jspui</em> &#45; Contains all customizations for the JSP User Interface.
				<ul>
					<li><em>src/main/resources/</em> &#45; The overlay for JSPUI <em>Resources.</em> This is the location to place any custom Messages.properties files. <em>(Previously this file had been stored at: &#95;[dspace-source]/config/language-packs/Messages.properties</em>_</li>
					<li><em>src/main/webapp/</em> &#45; The overlay for JSPUI Web Application. This is the location to place any custom JSPs to be used by DSpace.</li>
				</ul>
				</li>
				<li><em>lni</em> &#45; Contains all customizations for the Lightweight Network Interface.</li>
				<li><em>oai</em> &#45; Contains all customizations for the OAI-PMH Interface.</li>
				<li><em>sword</em> &#45; Contains all customizations for the SWORD (Simple Web-service Offering Repository Deposit) Interface.</li>
				<li><em>xmlui</em> &#45; Contains all customizations for the XML User Interface (aka Manakin).
				<ul>
					<li><em>src/main/webapp/</em> &#45; The overlay for XMLUI Web Application. This is the location to place custom Themes or Configurations.
					<ul>
						<li><em>i18n/</em> &#45; The location to place a custom version of the XMLUI's messages.xml (You have to manually create this folder)</li>
						<li><em>themes/</em> &#45; The location to place custom Themes for the XMLUI (You have to manually create this folder).</li>
					</ul>
					</li>
				</ul>
				</li>
			</ul>
			</li>
			<li><em>src/</em> &#45; Maven configurations for DSpace System. This directory contains the Maven and Ant build files for DSpace.</li>
			<li><em>target/</em> &#45; (Only exists after building DSpace) This is the location Maven uses to build your DSpace installation package.
			<ul>
				<li><em>dspace-[version].dir</em> &#45; The location of the DSpace Installation Package (which can then be installed by running <em>ant update</em>)</li>
			</ul>
			</li>
		</ul>
		</li>
	</ul>
	</li>
</ul>


<h2><a name="Directories-InstalledDirectoryLayout"></a>Installed Directory Layout</h2>

<p>Below is the basic layout of a DSpace installation using the default configuration. These paths can be configured if necessary.</p>

<ul>
	<li><em>[dspace]</em>
	<ul>
		<li><em>assetstore/</em> &#45; asset store files</li>
		<li><em>bin/</em> &#45; shell and Perl scripts</li>
		<li><em>config/</em> &#45; configuration, with sub-directories as above</li>
		<li><em>handle-server/</em> &#45; Handles server files</li>
		<li><em>history/</em> &#45; stored history files (generally RDF/XML)</li>
		<li><em>lib/</em> &#45; JARs, including dspace.jar, containing the DSpace classes</li>
		<li><em>log/</em> &#45; Log files</li>
		<li><em>reports/</em> &#45; Reports generated by statistical report generator</li>
		<li><em>search/</em> &#45; Lucene search index files</li>
		<li><em>upload/</em> &#45; temporary directory used during file uploads etc.</li>
		<li><em>webapps/</em> &#45; location where DSpace installs all Web Applications</li>
	</ul>
	</li>
</ul>


<h2><a name="Directories-ContentsofJSPUIWebApplication"></a>Contents of JSPUI Web Application</h2>

<p>DSpace's Ant build file creates a <em>dspace-jspui-webapp/</em> directory with the following structure:</p>

<ul>
	<li>(top level dir)
	<ul>
		<li>The JSPs</li>
		<li><em>WEB-INF/</em>
		<ul>
			<li><em>web.xml</em> &#45; DSpace JSPUI Web Application configuration and Servlet mappings</li>
			<li><em>dspace-tags.tld</em> &#45; DSpace custom tag descriptor</li>
			<li><em>fmt.tld</em> &#45; JSTL message format tag descriptor, for internationalization</li>
			<li><em>lib/</em> &#45; All the third-party JARs and pre-compiled DSpace API JARs needed to run JSPUI</li>
			<li><em>classes/</em> &#45; Any additional necessary class files</li>
		</ul>
		</li>
	</ul>
	</li>
</ul>


<h2><a name="Directories-ContentsofXMLUIWebApplication%28akaManakin%29"></a>Contents of XMLUI Web Application (aka Manakin)</h2>

<p>DSpace's Ant build file creates a <em>dspace-xmlui-webapp/</em> directory with the following structure:</p>

<ul>
	<li>(top level dir)
	<ul>
		<li><em>aspects/</em> &#45; Contains overarching Aspect Generator config and Prototype DRI (Digital Repository Interface) document for Manakin.</li>
		<li><em>i18n/</em> &#45; Internationalization / Multilingual support. Contains the <em>messages.xml</em> English language pack by default.</li>
		<li><em>themes/</em> &#45; Contains all out-of-the-box Manakin themes
		<ul>
			<li><em>Classic/</em> &#45; The classic theme, which makes the XMLUI look like classic DSpace</li>
			<li><em>Kubrick/</em> &#45; The Kubrick theme</li>
			<li><em>Mirage/</em> &#45; The Mirage theme (see <a href="Mirage Configuration and Customization.html" title="Mirage Configuration and Customization">Mirage Configuration and Customization</a>)</li>
			<li><em>Reference/</em> &#45; The default reference theme for XMLUI</li>
			<li><em>dri2xhtml/</em> &#45; The base theme template, which converts XMLUI DRI (Digital Repository Interface) format into XHTML for display. See <a href="XMLUI Base Theme Templates (dri2xhtml).html" title="XMLUI Base Theme Templates (dri2xhtml)">XMLUI Base Theme Templates &#40;dri2xhtml&#41;</a> for more details.</li>
			<li><em>dri2xhtml-alt/</em> &#45; The alternative theme template (used by Mirage Theme), which also converts XMLUI DRI (Digital Repository Interface) format into XHTML for display. See <a href="XMLUI Base Theme Templates (dri2xhtml).html" title="XMLUI Base Theme Templates (dri2xhtml)">XMLUI Base Theme Templates &#40;dri2xhtml&#41;</a> for more details.</li>
			<li><em>template/</em> &#45; An empty theme template...useful as a starting point for your own custom theme(s)</li>
			<li><em>dri2xhtml.xsl</em> &#45; The DRI-to-XHTML XSL Stylesheet. Uses the above 'dri2xhtml' theme to generate XHTML</li>
			<li><em>themes.xmap</em> &#45; The Theme configuration file. It determines which theme(s) are used by XMLUI</li>
		</ul>
		</li>
		<li><em>WEB-INF/</em>
		<ul>
			<li><em>lib/</em> &#45; All the third-party JARs and pre-compiled DSpace JARs needed to run XMLUI</li>
			<li><em>classes/</em> &#45; Any additional necessary class files</li>
			<li><em>cocoon.xconf</em> &#45; XMLUI's Apache Cocoon configuration</li>
			<li><em>logkit.xconf</em> &#45; XMLUI's Apache Cocoon Logging configuration</li>
			<li><em>web.xml</em> &#45; XMLUI Web Application configuration and Servlet mappings</li>
		</ul>
		</li>
	</ul>
	</li>
</ul>


<h2><a name="Directories-LogFiles"></a>Log Files</h2>

<p>The first source of potential confusion is the log files. Since DSpace uses a number of third-party tools, problems can occur in a variety of places. Below is a table listing the main log files used in a typical DSpace setup. The locations given are defaults, and might be different for your system depending on where you installed DSpace and the third-party tools. The ordering of the list is roughly the recommended order for searching them for the details about a particular problem or error.</p>
<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<td class='confluenceTd'> <b>Log File</b> </td>
<td class='confluenceTd'> <b>What's In It</b> </td>
</tr>
<tr>
<td class='confluenceTd'> <em>[dspace]/log/dspace.log.yyyy-mm-dd</em> </td>
<td class='confluenceTd'> Main DSpace log file. This is where the DSpace code writes a simple log of events and errors that occur within the DSpace code. You can control the verbosity of this by editing the <em>[dspace-source]/config/templates/log4j.properties</em> file and then running "<em>ant init_configs</em>". </td>
</tr>
<tr>
<td class='confluenceTd'> <em>[dspace]/log/cocoon.log.yyyy-mm-dd</em> </td>
<td class='confluenceTd'> Apache Cocoon log file for the XMLUI. This is where the DSpace XMLUI logs all of its events and errors. </td>
</tr>
<tr>
<td class='confluenceTd'> <em>[tomcat]/logs/catalina.out</em> </td>
<td class='confluenceTd'> This is where Tomcat's standard output is written. Many errors that occur within the Tomcat code are logged here. For example, if Tomcat can't find the DSpace code (<em>dspace.jar</em>), it would be logged in <em>catalina.out</em>. </td>
</tr>
<tr>
<td class='confluenceTd'> <em>[tomcat]/logs/hostname_log.yyyy-mm-dd.txt</em> </td>
<td class='confluenceTd'> If you're running Tomcat stand-alone (without Apache), it logs some information and errors for specific Web applications to this log file. <em>hostname</em> will be your host name (e.g. <em>dspace.myu.edu</em>) and <em>yyyy-mm-dd</em> will be the date. </td>
</tr>
<tr>
<td class='confluenceTd'> <em>[tomcat]/logs/apache_log.yyyy-mm-dd.txt</em> </td>
<td class='confluenceTd'> If you're using Apache, Tomcat logs information about Web applications running through Apache (<em>mod_webapp</em>) in this log file (<em>yyyy-mm-dd</em> being the date.) </td>
</tr>
<tr>
<td class='confluenceTd'> <em>[apache]/error_log</em> </td>
<td class='confluenceTd'> Apache logs to this file. If there is a problem with getting <em>mod_webapp</em> working, this is a good place to look for clues. Apache also writes to several other log files, though <em>error_log</em> tends to contain the most useful information for tracking down problems. </td>
</tr>
<tr>
<td class='confluenceTd'> <em>[dspace]/log/handle-plug.log</em> </td>
<td class='confluenceTd'> The Handle server runs as a separate process from the DSpace Web UI (which runs under Tomcat's JVM). Due to a limitation of log4j's 'rolling file appenders', the DSpace code running in the Handle server's JVM must use a separate log file. The DSpace code that is run as part of a Handle resolution request writes log information to this file. You can control the verbosity of this by editing <em>[dspace-source]/config/templates/log4j-handle-plugin.properties</em>. </td>
</tr>
<tr>
<td class='confluenceTd'> <em>[dspace]/log/handle-server.log</em> </td>
<td class='confluenceTd'> This is the log file for CNRI's Handle server code. If a problem occurs within the Handle server code, before DSpace's plug-in is invoked, this is where it may be logged. </td>
</tr>
<tr>
<td class='confluenceTd'> <em>[dspace]/handle-server/error.log</em> </td>
<td class='confluenceTd'> On the other hand, a problem with CNRI's Handle server code might be logged here. </td>
</tr>
<tr>
<td class='confluenceTd'> <em>PostgreSQL log</em> </td>
<td class='confluenceTd'> PostgreSQL also writes a log file. This one doesn't seem to have a default location, you probably had to specify it yourself at some point during installation. In general, this log file rarely contains pertinent information--PostgreSQL is pretty stable, you're more likely to encounter problems with connecting via JDBC, and these problems will be logged in <em>dspace.log</em>. </td>
</tr>
</tbody></table>
</div>


<h3><a name="Directories-log4j.propertiesFile."></a>log4j.properties File.</h3>

<p>the file <em>[dspace]/config/log4j.properties</em> controls how and where log files are created.  There are three sets of configurations in that file, called A1, A2, and A3.  These are used to control the logs for DSpace, the checksum checker, and the XMLUI respectively.   The important settings in this file are:</p>
<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<td class='confluenceTd'> <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">log4j.rootCategory=INFO,A
log4j.logger.org.dspace=INFO,A1</pre>
</div></div> </td>
<td class='confluenceTd'> These lines control what level of logging takes place.  Normally they should be set to INFO, but if you need to see more information in the logs, set them to DEBUG and restart your web server </td>
</tr>
<tr>
<td class='confluenceTd'> <em>log4j.appender.A1=org.dspace.app.util.DailyFileAppender</em> </td>
<td class='confluenceTd'> This is the name of the log file creation method used.  The DailyFileAppender creates a new date-stamped file every day or month. </td>
</tr>
<tr>
<td class='confluenceTd'> <em>log4j.appender.A1.File=${log.dir}/dspace.log</em> </td>
<td class='confluenceTd'> This sets the filename and location of where the log file will be stored.  It iwll have a date stamp appended to the file name. </td>
</tr>
<tr>
<td class='confluenceTd'> <em>log4j.appender.A1.DatePattern=yyy-MM-DD</em> </td>
<td class='confluenceTd'> This defines the format for the date stamp that is appended to the log file names.  If you wish to have log files created monthly instead of daily, change this to <em>yyyy-MM</em> </td>
</tr>
<tr>
<td class='confluenceTd'> <em>log4j.appender.A1.MaxLogs=0</em> </td>
<td class='confluenceTd'> This defines how many log files will be created. You may wish to define a retention period for log files.  If you set this to 365, logs older than  a year will be deleted. By default this is set to 0 so that no logs are ever deleted. Ensure that you monitor the disk space used by the logs to make sure that you have enough space for them.  It is often important to keep the log files for a long time in case you want to rebuild your statistics. </td>
</tr>
</tbody></table>
</div>


				    
                    			    </td>
		    </tr>
	    </table>
	    <table border="0" cellpadding="0" cellspacing="0" width="100%">
			<tr>
				<td height="12" background="https://wiki.duraspace.org/images/border/border_bottom.gif"><img src="images/border/spacer.gif" width="1" height="1" border="0"/></td>
			</tr>
		    <tr>
			    <td align="center"><font color="grey">Document generated by Confluence on Mar 25, 2011 19:21</font></td>
		    </tr>
	    </table>
    </body>
</html>